package com.third.bank.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.third.bank.Dto.TransactionRecordsDto;
import com.third.bank.Dto.TransferDto;
import com.third.bank.entity.TransactionRecords;
import com.third.bank.service.TransactionRecordsService;
import com.third.bank.util.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 转账交易controller
 */
@Api(tags = "转账接口")
@RestController
@RequestMapping("/transfer")
public class TransferController {

    @Autowired
    private TransactionRecordsService transactionRecordsService;

    @ApiOperation(value = "用户进行转账")
    @PostMapping("/transferOperation")
    public BaseResponse transfer(@RequestBody TransferDto trans) {
        BaseResponse result = transactionRecordsService.transfer(trans);
        return result;
    }

}
